package com.six.core.controller;

import com.six.core.entity.Permission;
import com.six.core.service.PermissionService;
import com.six.core.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

/**
 * @Description:
 * @author:LiWei
 * @date:2023年02月27日15:37
 */

@Api(value = "permission", tags = {":"})
@RestController
@RequestMapping("/system/permission")
public class PermissionController {

    @Autowired
    private PermissionService permissionService;

    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "HttpServletRequest", name = "request", value = "", required = false)
    })
    @ApiOperation(value = "", notes = "", httpMethod = "POST")
    @PostMapping("/leftMenu")
    public Result leftMenu(){
        return permissionService.findByEmpId();
    }


    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "string", name = "id", value = "", required = false)
    })
    @ApiOperation(value = "", notes = "", httpMethod = "POST")
    @PostMapping("/findPermission")
    public List<Permission> findByPermission(Integer id){
        return permissionService.findByPermission(id);
    };



}
